home *** CD-ROM | disk | FTP | other *** search
- Path: soap.news.pipex.net!pipex!usenet
- From: m.hendry@dial.pipex.com (Mathew Hendry)
- Newsgroups: comp.sys.amiga.applications
- Subject: Executive and screen blankers (was Re: Executive and AmiTCP..)
- Date: Tue, 27 Feb 96 19:00:52
- Organization: Private node.
- Distribution: world
- Message-ID: <19960227.41C5A0.1156B@an052.du.pipex.com>
- References: <4gv6l6$qb6@walrus.megabaud.fi>
- NNTP-Posting-Host: an052.du.pipex.com
- X-Newsreader: TIN [AMIGA 1.3 950726BETA PL0]
-
- Petri Nordlund (petrin@walrus.megabaud.fi) wrote:
- : Mathew Hendry (m.hendry@dial.pipex.com) writes:
- : >The only way to fix it completely would be to add a capability to BlitzBlank
- : >to keep an eye on Executive's CPU load stats, so that it could switch to
- : >another blanking method which consumes less or no CPU time when the total
- : >CPU load reaches a preset threshold. BlitzBlank does have its own "Watch CPU"
- : >option, but it doesn't work properly when Executive is running.
- :
- : The best solution would be to run the blanker in a totally separate
- : task at low priority (below Executive's catch range) and have another
- : task watching for mouse movement and keyboard, so the screen could
- : be easily unblanked (the blanker task's priority has to be first
- : raised so it will get CPU time to close it's screen).
-
- That's basically what BlitzBlank does. The main BlitzBlank task, which detects
- mouse and keyboard activity, runs at priority 10, well above the catch range.
- When the screen is blanked, two new tasks appear - BB.Module and BB.WatchTask,
- at the same priority as each other (-5 is the recommended value). If
- BB.WatchTask is getting no CPU time (I'm not sure how the BlitzBlank task
- recognises this - I am guessing that it is some sort of message-based system,
- i.e. if BB.WatchTask does not repond to a message quickly enough, it is
- assumed to be getting no CPU), BB.Module is stopped and replaced with a blank
- screen.
-
- Such a method doesn't work with Executive running, of course, because all
- sheduled tasks are given CPU time. If BB.WatchTask was removed and BlitzBlank
- instead kept an eye on Executive's CPU load stats, things would work fine.
-
- With such a system, there would be no need to place the blanker module below
- the catch range, since it would automatically be stopped when the load
- increased. And, being within the catch range, it would have access to the CPU
- in order to stop itself. Temporarily raising the priority of BB.Module _above_
- the catch range would allow it to respond more quickly - its priority should
- be raised similarly when an input event occurs.
-
- Specifically:
-
- if(total_load() > 1) {
- open_black_screen();
- set_priority(BB.Module, above_catch_range);
- stop_module(BB.Module);
- }
-
- will stop the blanker module as soon as all available CPU time is being consumed,
- Until the total load reaches 1, there is no need to stop the module.
-
- Deciding when to start up the blanker module again would be more difficult. I
- can't think of a reliable test for this offhand.
-
- Perhaps:
-
- if(total_load() + lastload(BB.Module) <= 1) {
- start_module(BB.Module);
- close_black_screen();
- }
-
- lastload(BB.Module) being the load BB.Module was producing just before it was
- stopped by the previous routine. The problem is that this assumes that the
- module will produce the same load each time it is run. That may not be true.
- It could also be deceived if the load decreases temporarily, for example
- during disk access to load / save new data.
-
- (Actually, come to think of it, the first routine could be misled in a similar
- way, but this would not be an error which harmed the performance of other
- applications).
-
- It might just be easier to leave the black screen open until the screen is
- unblanked by the user. That would also stop the blanker from continually
- flipping between a black screen and a graphical module as the load fluctuates.
-
- -- Mat.
-